#ifndef PIN_HPP
#define PIN_HPP

class Pin {
public:
    enum class Mode {
        Input,
        Output
    };

    enum class DriveType {
        PushPull,
        OpenDrain
    };

    enum class PullType {
        None,
        PullUp,
        PullDown
    };

    enum class EventType {
        RisingEdge,
        FallingEdge,
        BothEdge
    };

    typedef void (*EventCallback)(void);
public:
    virtual ~Pin() = 0;
    virtual bool open(void) = 0;
    virtual bool close(void) = 0;
    virtual void set(bool status) = 0;
    virtual bool get(void) = 0;
    virtual void toggle(void);

    virtual bool setMode(Mode mode) = 0;
    virtual Mode getMode(void) = 0;
    virtual bool setDriveType(DriveType drive_type) = 0;
    virtual DriveType getDriveType(void) = 0;
    virtual bool setPullType(PullType pull_type) = 0;
    virtual PullType getPullType(void) = 0;

    virtual bool registEvent(EventType event_type,EventCallback event_callback) = 0;
    virtual bool unregistEvent(EventType event_type) = 0;
};

#endif
